/**
 * 询价.COM v1.0.0
 * http://xun-jia.com/
 *
 * Copyright (c) 2009 
 * 四川漾天空网络科技有限公司
 * 成都市天府软件园A3栋2楼
 *
 */
package com.xunjia.setup.action;

import org.apache.log4j.Logger;

import com.opensymphony.xwork2.Action;
import com.xunjia.action.XunJiaActionSupport;

/**
 * @author Mark
 * 
 * @Email Mark_yang@xun-jia.com
 * 
 * @Date 2009-4-10 下午12:55:42
 * 
 */
public class WalletSetupAction extends XunJiaActionSupport {
	// 日志
	private static final Logger logger = Logger.getLogger(WalletSetupAction.class);
	private static final long serialVersionUID = 2143687775043385745L;
	// 开启
	private static final String OPEN = "open";
	// 关闭
	private static final String CLOSE = "close";
	// 冻结
	private static final String FREEZE = "freeze";
	// 解冻
	private static final String MELT = "melt";
	// 每日消費限制
	private static final String DAY = "day";
	// 每次消費限制
	private static final String TIME = "time";
	// 余款變更手機通知是否開啟
	private String mobileNotify = OPEN;
	// 余款變更郵件通知是否開啟
	private String emailNotify = CLOSE;
	// 凍結錢包
	private String freezeWallet = FREEZE;
	// 消费限制
	private String expenseLimit;
	// 消費類型(日,次)
	private String expenseType;

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.opensymphony.xwork2.ActionSupport#execute()
	 */
	@Override
	public String execute() throws Exception {
		return Action.SUCCESS;
	}

	/**
	 * 錢包設置操作
	 * 
	 * @return
	 * @throws Exception
	 */
	public String walletSetup() throws Exception {
		// addFieldError("freezeWallet", getText("setup.wallet.freeze.error"));
		addActionMessage(getText("setup.wallet.freeze.success"));
		return Action.SUCCESS;
	}

	/**
	 * 消費限制設置
	 * 
	 * @return
	 * @throws Exception
	 */
	public String consumeLimitSetup() throws Exception {
		if (DAY.equals(expenseType)) {

		} else if (TIME.equals(expenseType)) {

		}
		// addFieldError("expenseLimit", getText("setup.expense.limit.error"));
		addActionMessage(getText("setup.expense.limit.success"));
		return Action.SUCCESS;
	}

	/**
	 * 郵件通知設置
	 * 
	 * @return
	 * @throws Exception
	 */
	public String emailNotifySetup() throws Exception {
		// addFieldError("emailNotify", getText("setup.email.nofity.error"));
		addActionMessage(getText("setup.email.nofity.success"));
		return Action.SUCCESS;
	}

	/**
	 * 手機通知調協
	 * 
	 * @return
	 * @throws Exception
	 */
	public String mobileNotifySetup() throws Exception {
		// addFieldError("mobileNotify", getText("setup.mobile.nofity.error"));
		addActionMessage(getText("setup.mobile.nofity.success"));
		return Action.SUCCESS;
	}

	/**
	 * @return the expenseLimit
	 */
	public String getExpenseLimit() {
		return expenseLimit;
	}

	/**
	 * @param expenseLimit
	 *            the expenseLimit to set
	 */
	public void setExpenseLimit(String expenseLimit) {
		this.expenseLimit = expenseLimit;
	}

	/**
	 * @return the mobileNotify
	 */
	public String getMobileNotify() {
		return mobileNotify;
	}

	/**
	 * @param mobileNotify
	 *            the mobileNotify to set
	 */
	public void setMobileNotify(String mobileNotify) {
		this.mobileNotify = mobileNotify;
	}

	/**
	 * @return the emailNotify
	 */
	public String getEmailNotify() {
		return emailNotify;
	}

	/**
	 * @param emailNotify
	 *            the emailNotify to set
	 */
	public void setEmailNotify(String emailNotify) {
		this.emailNotify = emailNotify;
	}

	/**
	 * @return the freezeWallet
	 */
	public String getFreezeWallet() {
		return freezeWallet;
	}

	/**
	 * @param freezeWallet
	 *            the freezeWallet to set
	 */
	public void setFreezeWallet(String freezeWallet) {
		this.freezeWallet = freezeWallet;
	}

	/**
	 * @return the expenseType
	 */
	public String getExpenseType() {
		return expenseType;
	}

	/**
	 * @param expenseType
	 *            the expenseType to set
	 */
	public void setExpenseType(String expenseType) {
		this.expenseType = expenseType;
	}

}
